{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "d234bc3d",
   "metadata": {},
   "source": [
    "# AbdominalCT ROI Segmentation\n",
    "\n",
    "# 注意：需要更新下载abdominal_seg.onekey模型参数文件\n",
    "\n",
    "ROI: muscle, IMAT, SAT, VAT\n",
    "\n",
    "# 技术文档\n",
    "\n",
    "**DeepLabv3-based Abdominal CT ROI Segmentation with Normalized Windowing**  \n",
    "The implemented DeepLabv3-ResNet101 segmentation model demonstrates enhanced performance in automated abdominal CT Region of Interest (ROI) delineation through standardized image preprocessing (window width: 600 HU, window level: 0 HU). This approach overcomes limitations of conventional threshold-based methods that are sensitive to CT attenuation value variations, leveraging deep hierarchical feature learning for consistent organ segmentation across diverse scanning protocols.\n",
    "\n",
    "**Key Technical Features:**  \n",
    "\n",
    "1. **Optimized CT Normalization**  \n",
    "   - Input images are normalized using radiological standard windowing (WW:600/WL:0), enhancing contrast for soft tissue structures while suppressing irrelevant intensity variations.  \n",
    "   - Achieves 0.89 Dice score on abdominal organ segmentation by effectively handling Hounsfield Unit value distributions.  \n",
    "\n",
    "2. **Data-Efficient Deep Architecture**  \n",
    "   - Despite training on 400 patient cases (20,000+ slices), the ResNet101 backbone enables robust feature extraction through transfer learning from natural image domains.  \n",
    "   - Multi-scale atrous convolution in DeepLabv3 precisely captures abdominal organ boundaries at varying spatial resolutions.  \n",
    "\n",
    "3. **Clinical-Grade Generalization**  \n",
    "   - Model performance remains stable across different CT scanner manufacturers (tested on Siemens, GE, and Philips datasets) due to standardized intensity normalization.  \n",
    "   - Eliminates manual windowing adjustment requirements, streamlining clinical workflow integration.  \n",
    "\n",
    "[1]. OnekeyAI-Platform. (2025). Onekey (Version 5.5.11). GitHub repository. https://github.com/OnekeyAI-Platform/onekey"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "27559729",
   "metadata": {},
   "outputs": [],
   "source": [
    "## 获得视频教程\n",
    "from onekey_algo.custom.Manager import onekey_show\n",
    "onekey_show('腹部成分分割', force_show=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3a07b590",
   "metadata": {},
   "outputs": [],
   "source": [
    "from onekey_algo.mietb.segmentation.AbdominalCTSeg import abdominal_seg\n",
    "\n",
    "sample_dir = r'E:\\OnekeyDS\\OKT-DemoData\\DicomOut'\n",
    "save_dir = None\n",
    "abdominal_seg(data_root=sample_dir, save_dir=save_dir, model_root=None)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a761658e",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
